package com.framework.seedkit.base;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;

import com.framework.seedkit.app.AppActivityManager;

import butterknife.ButterKnife;

public abstract class BaseActivity extends Activity implements BaseViewInterface {
	protected final String HTTP_TASK_KEY = "HttpTaskKey_" + hashCode();
	public String tag;
	protected Context mContext = null;
	protected LayoutInflater mInflater = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		mContext = this;
		tag = this.getClass().getSimpleName();
		AppActivityManager.getAppManager().addActivity(this);

		if (getLayoutId() != 0) {
			setContentView(getLayoutId());
		}

		mInflater = getLayoutInflater();

		ButterKnife.bind(this);

		initView();

		initData();
	}

	protected int getLayoutId() {
		return 0;
	}

	protected View inflateView(int resId) {
		return mInflater.inflate(resId, null);
	}

	@Override
	protected void onResume() {
		super.onResume();

	}

	@Override
	protected void onPause() {
		super.onPause();
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();

		AppActivityManager.getAppManager().finishActivity(this);
	}

	@Override
	public void initView() {

	}

	@Override
	public void initData() {

	}
}
